package comday04.itheima01;

public class Demo07 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        int[] arr2 = arr;  //把arr的地址值赋值给arr2

        //给数组元素赋值
        arr[1] = 10;
        arr[3] = 20;
        arr2[0] = 111;
        arr2[3] = 222;

        //遍历
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }
}
